home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Dev / misc / temgen.lha / Temgen / tg-0.11 / lex.yy.c < prev    next >
C/C++ Source or Header  |  2004-06-11  |  51KB  |  2,025 lines

  1. /* A lexical scanner generated by flex */
  2.  
  3. /* Scanner skeleton version:
  4.  * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
  5.  */
  6.  
  7. #define FLEX_SCANNER
  8. #define YY_FLEX_MAJOR_VERSION 2
  9. #define YY_FLEX_MINOR_VERSION 5
  10.  
  11. #include <stdio.h>
  12.  
  13.  
  14. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  15. #ifdef c_plusplus
  16. #ifndef __cplusplus
  17. #define __cplusplus
  18. #endif
  19. #endif
  20.  
  21.  
  22. #ifdef __cplusplus
  23.  
  24. #include <stdlib.h>
  25. #include <unistd.h>
  26.  
  27. /* Use prototypes in function declarations. */
  28. #define YY_USE_PROTOS
  29.  
  30. /* The "const" storage-class-modifier is valid. */
  31. #define YY_USE_CONST
  32.  
  33. #else    /* ! __cplusplus */
  34.  
  35. #if __STDC__
  36.  
  37. #define YY_USE_PROTOS
  38. #define YY_USE_CONST
  39.  
  40. #endif    /* __STDC__ */
  41. #endif    /* ! __cplusplus */
  42.  
  43. #ifdef __TURBOC__
  44.  #pragma warn -rch
  45.  #pragma warn -use
  46. #include <io.h>
  47. #include <stdlib.h>
  48. #define YY_USE_CONST
  49. #define YY_USE_PROTOS
  50. #endif
  51.  
  52. #ifdef YY_USE_CONST
  53. #define yyconst const
  54. #else
  55. #define yyconst
  56. #endif
  57.  
  58.  
  59. #ifdef YY_USE_PROTOS
  60. #define YY_PROTO(proto) proto
  61. #else
  62. #define YY_PROTO(proto) ()
  63. #endif
  64.  
  65. /* Returned upon end-of-file. */
  66. #define YY_NULL 0
  67.  
  68. /* Promotes a possibly negative, possibly signed char to an unsigned
  69.  * integer for use as an array index.  If the signed char is negative,
  70.  * we want to instead treat it as an 8-bit unsigned char, hence the
  71.  * double cast.
  72.  */
  73. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  74.  
  75. /* Enter a start condition.  This macro really ought to take a parameter,
  76.  * but we do it the disgusting crufty way forced on us by the ()-less
  77.  * definition of BEGIN.
  78.  */
  79. #define BEGIN yy_start = 1 + 2 *
  80.  
  81. /* Translate the current start state into a value that can be later handed
  82.  * to BEGIN to return to the state.  The YYSTATE alias is for lex
  83.  * compatibility.
  84.  */
  85. #define YY_START ((yy_start - 1) / 2)
  86. #define YYSTATE YY_START
  87.  
  88. /* Action number for EOF rule of a given start state. */
  89. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  90.  
  91. /* Special action meaning "start processing a new file". */
  92. #define YY_NEW_FILE yyrestart( yyin )
  93.  
  94. #define YY_END_OF_BUFFER_CHAR 0
  95.  
  96. /* Size of default input buffer. */
  97. #define YY_BUF_SIZE 16384
  98.  
  99. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  100.  
  101. extern int yyleng;
  102. extern FILE *yyin, *yyout;
  103.  
  104. #define EOB_ACT_CONTINUE_SCAN 0
  105. #define EOB_ACT_END_OF_FILE 1
  106. #define EOB_ACT_LAST_MATCH 2
  107.  
  108. /* The funky do-while in the following #define is used to turn the definition
  109.  * int a single C statement (which needs a semi-colon terminator).  This
  110.  * avoids problems with code like:
  111.  *
  112.  *     if ( condition_holds )
  113.  *        yyless( 5 );
  114.  *    else
  115.  *        do_something_else();
  116.  *
  117.  * Prior to using the do-while the compiler would get upset at the
  118.  * "else" because it interpreted the "if" statement as being all
  119.  * done when it reached the ';' after the yyless() call.
  120.  */
  121.  
  122. /* Return all but the first 'n' matched characters back to the input stream. */
  123.  
  124. #define yyless(n) \
  125.     do \
  126.         { \
  127.         /* Undo effects of setting up yytext. */ \
  128.         *yy_cp = yy_hold_char; \
  129.         YY_RESTORE_YY_MORE_OFFSET \
  130.         yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
  131.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  132.         } \
  133.     while ( 0 )
  134.  
  135. #define unput(c) yyunput( c, yytext_ptr )
  136.  
  137. /* The following is because we cannot portably get our hands on size_t
  138.  * (without autoconf's help, which isn't available because we want
  139.  * flex-generated scanners to compile on their own).
  140.  */
  141. typedef unsigned int yy_size_t;
  142.  
  143.  
  144. struct yy_buffer_state
  145.     {
  146.     FILE *yy_input_file;
  147.  
  148.     char *yy_ch_buf;        /* input buffer */
  149.     char *yy_buf_pos;        /* current position in input buffer */
  150.  
  151.     /* Size of input buffer in bytes, not including room for EOB
  152.      * characters.
  153.      */
  154.     yy_size_t yy_buf_size;
  155.  
  156.     /* Number of characters read into yy_ch_buf, not including EOB
  157.      * characters.
  158.      */
  159.     int yy_n_chars;
  160.  
  161.     /* Whether we "own" the buffer - i.e., we know we created it,
  162.      * and can realloc() it to grow it, and should free() it to
  163.      * delete it.
  164.      */
  165.     int yy_is_our_buffer;
  166.  
  167.     /* Whether this is an "interactive" input source; if so, and
  168.      * if we're using stdio for input, then we want to use getc()
  169.      * instead of fread(), to make sure we stop fetching input after
  170.      * each newline.
  171.      */
  172.     int yy_is_interactive;
  173.  
  174.     /* Whether we're considered to be at the beginning of a line.
  175.      * If so, '^' rules will be active on the next match, otherwise
  176.      * not.
  177.      */
  178.     int yy_at_bol;
  179.  
  180.     /* Whether to try to fill the input buffer when we reach the
  181.      * end of it.
  182.      */
  183.     int yy_fill_buffer;
  184.  
  185.     int yy_buffer_status;
  186. #define YY_BUFFER_NEW 0
  187. #define YY_BUFFER_NORMAL 1
  188.     /* When an EOF's been seen but there's still some text to process
  189.      * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  190.      * shouldn't try reading from the input source any more.  We might
  191.      * still have a bunch of tokens to match, though, because of
  192.      * possible backing-up.
  193.      *
  194.      * When we actually see the EOF, we change the status to "new"
  195.      * (via yyrestart()), so that the user can continue scanning by
  196.      * just pointing yyin at a new input file.
  197.      */
  198. #define YY_BUFFER_EOF_PENDING 2
  199.     };
  200.  
  201. static YY_BUFFER_STATE yy_current_buffer = 0;
  202.  
  203. /* We provide macros for accessing buffer states in case in the
  204.  * future we want to put the buffer states in a more general
  205.  * "scanner state".
  206.  */
  207. #define YY_CURRENT_BUFFER yy_current_buffer
  208.  
  209.  
  210. /* yy_hold_char holds the character lost when yytext is formed. */
  211. static char yy_hold_char;
  212.  
  213. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  214.  
  215.  
  216. int yyleng;
  217.  
  218. /* Points to current character in buffer. */
  219. static char *yy_c_buf_p = (char *) 0;
  220. static int yy_init = 1;        /* whether we need to initialize */
  221. static int yy_start = 0;    /* start state number */
  222.  
  223. /* Flag which is used to allow yywrap()'s to do buffer switches
  224.  * instead of setting up a fresh yyin.  A bit of a hack ...
  225.  */
  226. static int yy_did_buffer_switch_on_eof;
  227.  
  228. void yyrestart YY_PROTO(( FILE *input_file ));
  229.  
  230. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  231. void yy_load_buffer_state YY_PROTO(( void ));
  232. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  233. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  234. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  235. void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  236. #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
  237.  
  238. YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
  239. YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
  240. YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
  241.  
  242. static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
  243. static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
  244. static void yy_flex_free YY_PROTO(( void * ));
  245.  
  246. #define yy_new_buffer yy_create_buffer
  247.  
  248. #define yy_set_interactive(is_interactive) \
  249.     { \
  250.     if ( ! yy_current_buffer ) \
  251.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  252.     yy_current_buffer->yy_is_interactive = is_interactive; \
  253.     }
  254.  
  255. #define yy_set_bol(at_bol) \
  256.     { \
  257.     if ( ! yy_current_buffer ) \
  258.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  259.     yy_current_buffer->yy_at_bol = at_bol; \
  260.     }
  261.  
  262. #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
  263.  
  264. typedef unsigned char YY_CHAR;
  265. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  266. typedef int yy_state_type;
  267. extern char *yytext;
  268. #define yytext_ptr yytext
  269.  
  270. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  271. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  272. static int yy_get_next_buffer YY_PROTO(( void ));
  273. static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
  274.  
  275. /* Done after the current pattern has been matched and before the
  276.  * corresponding action - sets up yytext.
  277.  */
  278. #define YY_DO_BEFORE_ACTION \
  279.     yytext_ptr = yy_bp; \
  280.     yyleng = (int) (yy_cp - yy_bp); \
  281.     yy_hold_char = *yy_cp; \
  282.     *yy_cp = '\0'; \
  283.     yy_c_buf_p = yy_cp;
  284.  
  285. #define YY_NUM_RULES 63
  286. #define YY_END_OF_BUFFER 64
  287. static yyconst short int yy_accept[151] =
  288.     {   0,
  289.         6,    6,   64,   42,    6,   41,   22,   42,   42,   12,
  290.        42,   42,   35,   36,   23,   24,   14,   25,   13,   26,
  291.         2,   39,   40,   18,   17,   19,    5,   37,   42,   38,
  292.         5,   42,   11,    6,   16,    0,   10,    0,    8,   34,
  293.         0,    9,   27,   31,   28,   32,   29,   30,    0,    2,
  294.        20,   15,   21,    5,    1,    1,    0,    4,   33,    0,
  295.         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  296.         0,    3,    0,    7,    0,    0,    0,    0,    0,    0,
  297.         0,    0,   43,    0,    0,    0,    0,    0,    0,    0,
  298.         0,    0,    0,    0,    0,    0,    0,   52,    0,    0,
  299.  
  300.         0,   58,    0,    0,    0,   61,    0,   51,   44,    0,
  301.        47,    0,    0,    0,   62,    0,    0,    0,   57,    0,
  302.         0,   56,   46,    0,    0,   45,    0,    0,   60,    0,
  303.         0,    0,   54,    0,    0,    0,   59,   55,   50,    0,
  304.         0,    0,    0,    0,   48,    0,   53,    0,   49,    0
  305.     } ;
  306.  
  307. static yyconst int yy_ec[256] =
  308.     {   0,
  309.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  310.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  311.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  312.         1,    2,    4,    5,    6,    7,    1,    8,    9,   10,
  313.        11,   12,   13,   14,   15,   16,   17,   18,   18,   18,
  314.        18,   18,   18,   18,   18,   18,   18,   19,   20,   21,
  315.        22,   23,    1,   24,   25,   25,   25,   25,   25,   25,
  316.        25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
  317.        25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
  318.        26,   27,   28,    1,   25,    1,   29,   30,   31,   32,
  319.  
  320.        33,   34,   25,   35,   36,   25,   37,   38,   39,   40,
  321.        41,   42,   25,   43,   44,   45,   46,   25,   47,   48,
  322.        25,   25,    1,   49,    1,    1,    1,    1,    1,    1,
  323.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  324.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  325.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  326.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  327.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  328.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  329.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  330.  
  331.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  332.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  333.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  334.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  335.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  336.         1,    1,    1,    1,    1
  337.     } ;
  338.  
  339. static yyconst int yy_meta[50] =
  340.     {   0,
  341.         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
  342.         1,    1,    1,    1,    1,    1,    1,    3,    1,    1,
  343.         1,    1,    1,    1,    3,    1,    1,    1,    3,    3,
  344.         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  345.         3,    3,    3,    3,    3,    3,    3,    3,    1
  346.     } ;
  347.  
  348. static yyconst short int yy_base[156] =
  349.     {   0,
  350.         0,  160,  183,  185,  180,  185,  159,  175,  176,  185,
  351.       170,  168,  185,  185,  154,   37,  185,   36,  185,  153,
  352.        36,  185,  185,  152,  151,  150,    0,  185,   53,  185,
  353.       131,  121,   58,  167,  185,  163,  185,  164,  185,  185,
  354.       157,  185,  185,  152,  185,  185,  185,  185,  146,   45,
  355.       185,  185,  185,    0,  185,   62,  139,    0,  185,    0,
  356.       119,  132,   28,   16,  126,  118,  112,   28,  124,  109,
  357.       111,  136,   68,  185,  120,  108,  107,   42,  118,  113,
  358.       105,  107,  185,  115,  100,  102,   99,   97,  105,  107,
  359.       110,  105,  104,  103,   90,   39,   89,  185,  102,  103,
  360.  
  361.        89,  185,   95,   83,   83,  185,   90,  185,  185,   94,
  362.       185,   36,   91,   77,  185,   78,   84,   75,  185,   77,
  363.        88,  185,  185,   75,   77,  185,   76,   70,  185,   58,
  364.        58,   62,  185,   64,   48,   49,  185,  185,  185,   42,
  365.        55,   45,   48,   46,  185,   39,  185,   39,  185,  185,
  366.       104,  107,  110,   50,  113
  367.     } ;
  368.  
  369. static yyconst short int yy_def[156] =
  370.     {   0,
  371.       150,    1,  150,  150,  150,  150,  150,  151,  152,  150,
  372.       150,  153,  150,  150,  150,  150,  150,  150,  150,  150,
  373.       150,  150,  150,  150,  150,  150,  154,  150,  155,  150,
  374.       154,  150,  150,  150,  150,  151,  150,  152,  150,  150,
  375.       153,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  376.       150,  150,  150,  154,  150,  150,  150,  154,  150,   33,
  377.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  378.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  379.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  380.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  381.  
  382.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  383.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  384.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  385.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  386.       150,  150,  150,  150,  150,  150,  150,  150,  150,    0,
  387.       150,  150,  150,  150,  150
  388.     } ;
  389.  
  390. static yyconst short int yy_nxt[235] =
  391.     {   0,
  392.         4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
  393.        14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
  394.        24,   25,   26,    4,   27,   28,   29,   30,   27,   27,
  395.        27,   27,   27,   27,   27,   31,   27,   27,   27,   27,
  396.        27,   27,   27,   27,   27,   27,   27,   27,   32,   44,
  397.        46,   49,   54,   50,   56,   57,   81,   47,   45,   60,
  398.        49,   82,   50,   73,   57,   77,   78,   79,   86,   73,
  399.        57,   94,  112,   87,  113,   80,  124,   95,  149,  148,
  400.       147,  125,  114,  146,  145,  144,  143,   61,   62,  142,
  401.        63,   64,  141,   65,  140,   66,  139,  138,   67,   68,
  402.  
  403.        69,   70,  137,   71,   36,  136,   36,   38,   38,   38,
  404.        41,  135,   41,   55,   55,   55,  134,  133,  132,  131,
  405.       130,  129,  128,  127,  126,  123,  122,  121,  120,  119,
  406.       118,  117,  116,  115,  111,  110,  109,  108,  107,  106,
  407.       105,  104,  103,  102,  101,  100,   99,   98,   97,   96,
  408.        93,   92,   91,   72,   90,   89,   88,   85,   84,   83,
  409.        76,   75,   74,   72,   44,   42,   39,   37,   34,   59,
  410.        58,   53,   52,   51,   48,   43,   42,   40,   39,   37,
  411.        35,   34,  150,   33,    3,  150,  150,  150,  150,  150,
  412.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  413.  
  414.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  415.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  416.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  417.       150,  150,  150,  150
  418.     } ;
  419.  
  420. static yyconst short int yy_chk[235] =
  421.     {   0,
  422.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  423.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  424.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  425.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  426.         1,    1,    1,    1,    1,    1,    1,    1,    1,   16,
  427.        18,   21,  154,   21,   29,   29,   64,   18,   16,   33,
  428.        50,   64,   50,   56,   56,   63,   63,   63,   68,   73,
  429.        73,   78,   96,   68,   96,   63,  112,   78,  148,  146,
  430.       144,  112,   96,  143,  142,  141,  140,   33,   33,  136,
  431.        33,   33,  135,   33,  134,   33,  132,  131,   33,   33,
  432.  
  433.        33,   33,  130,   33,  151,  128,  151,  152,  152,  152,
  434.       153,  127,  153,  155,  155,  155,  125,  124,  121,  120,
  435.       118,  117,  116,  114,  113,  110,  107,  105,  104,  103,
  436.       101,  100,   99,   97,   95,   94,   93,   92,   91,   90,
  437.        89,   88,   87,   86,   85,   84,   82,   81,   80,   79,
  438.        77,   76,   75,   72,   71,   70,   69,   67,   66,   65,
  439.        62,   61,   57,   49,   44,   41,   38,   36,   34,   32,
  440.        31,   26,   25,   24,   20,   15,   12,   11,    9,    8,
  441.         7,    5,    3,    2,  150,  150,  150,  150,  150,  150,
  442.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  443.  
  444.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  445.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  446.       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
  447.       150,  150,  150,  150
  448.     } ;
  449.  
  450. static yy_state_type yy_last_accepting_state;
  451. static char *yy_last_accepting_cpos;
  452.  
  453. /* The intent behind this definition is that it'll catch
  454.  * any uses of REJECT which flex missed.
  455.  */
  456. #define REJECT reject_used_but_not_detected
  457. #define yymore() yymore_used_but_not_detected
  458. #define YY_MORE_ADJ 0
  459. #define YY_RESTORE_YY_MORE_OFFSET
  460. char *yytext;
  461. #line 1 "tg.l"
  462. #define INITIAL 0
  463. #line 2 "tg.l"
  464. #include "y.tab.h"
  465. #include "alloc.h"
  466. #include "sysdefs.h"
  467. #include "txttab.h"
  468.     
  469. YYSTYPE  yylval;
  470.  
  471. void no_operation() {};
  472. #define  dprintf  no_operation
  473.  
  474. int lineno = 1;
  475. int charno = 0;
  476.  
  477. extern struct txttab *text_table;
  478.  
  479. #define    SETYYLVAL(v)  { v.line=lineno; v.start=charno; \
  480.                            charno+=strlen(yytext); v.end=charno; \
  481.                            tt_token( text_table, yytext ); }
  482.  
  483. #define    STORETEXT()   { tt_token( text_table, yytext ); }                           
  484.  
  485.                                                
  486.                            
  487. #line 488 "lex.yy.c"
  488.  
  489. /* Macros after this point can all be overridden by user definitions in
  490.  * section 1.
  491.  */
  492.  
  493. #ifndef YY_SKIP_YYWRAP
  494. #ifdef __cplusplus
  495. extern "C" int yywrap YY_PROTO(( void ));
  496. #else
  497. extern int yywrap YY_PROTO(( void ));
  498. #endif
  499. #endif
  500.  
  501. #ifndef YY_NO_UNPUT
  502. static void yyunput YY_PROTO(( int c, char *buf_ptr ));
  503. #endif
  504.  
  505. #ifndef yytext_ptr
  506. static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
  507. #endif
  508.  
  509. #ifdef YY_NEED_STRLEN
  510. static int yy_flex_strlen YY_PROTO(( yyconst char * ));
  511. #endif
  512.  
  513. #ifndef YY_NO_INPUT
  514. #ifdef __cplusplus
  515. static int yyinput YY_PROTO(( void ));
  516. #else
  517. static int input YY_PROTO(( void ));
  518. #endif
  519. #endif
  520.  
  521. #if YY_STACK_USED
  522. static int yy_start_stack_ptr = 0;
  523. static int yy_start_stack_depth = 0;
  524. static int *yy_start_stack = 0;
  525. #ifndef YY_NO_PUSH_STATE
  526. static void yy_push_state YY_PROTO(( int new_state ));
  527. #endif
  528. #ifndef YY_NO_POP_STATE
  529. static void yy_pop_state YY_PROTO(( void ));
  530. #endif
  531. #ifndef YY_NO_TOP_STATE
  532. static int yy_top_state YY_PROTO(( void ));
  533. #endif
  534.  
  535. #else
  536. #define YY_NO_PUSH_STATE 1
  537. #define YY_NO_POP_STATE 1
  538. #define YY_NO_TOP_STATE 1
  539. #endif
  540.  
  541. #ifdef YY_MALLOC_DECL
  542. YY_MALLOC_DECL
  543. #else
  544. #if __STDC__
  545. #ifndef __cplusplus
  546. #include <stdlib.h>
  547. #endif
  548. #else
  549. /* Just try to get by without declaring the routines.  This will fail
  550.  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
  551.  * or sizeof(void*) != sizeof(int).
  552.  */
  553. #endif
  554. #endif
  555.  
  556. /* Amount of stuff to slurp up with each read. */
  557. #ifndef YY_READ_BUF_SIZE
  558. #define YY_READ_BUF_SIZE 8192
  559. #endif
  560.  
  561. /* Copy whatever the last rule matched to the standard output. */
  562.  
  563. #ifndef ECHO
  564. /* This used to be an fputs(), but since the string might contain NUL's,
  565.  * we now use fwrite().
  566.  */
  567. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  568. #endif
  569.  
  570. /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  571.  * is returned in "result".
  572.  */
  573. #ifndef YY_INPUT
  574. #define YY_INPUT(buf,result,max_size) \
  575.     if ( yy_current_buffer->yy_is_interactive ) \
  576.         { \
  577.         int c = '*', n; \
  578.         for ( n = 0; n < max_size && \
  579.                  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  580.             buf[n] = (char) c; \
  581.         if ( c == '\n' ) \
  582.             buf[n++] = (char) c; \
  583.         if ( c == EOF && ferror( yyin ) ) \
  584.             YY_FATAL_ERROR( "input in flex scanner failed" ); \
  585.         result = n; \
  586.         } \
  587.     else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
  588.           && ferror( yyin ) ) \
  589.         YY_FATAL_ERROR( "input in flex scanner failed" );
  590. #endif
  591.  
  592. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  593.  * we don't want an extra ';' after the "return" because that will cause
  594.  * some compilers to complain about unreachable statements.
  595.  */
  596. #ifndef yyterminate
  597. #define yyterminate() return YY_NULL
  598. #endif
  599.  
  600. /* Number of entries by which start-condition stack grows. */
  601. #ifndef YY_START_STACK_INCR
  602. #define YY_START_STACK_INCR 25
  603. #endif
  604.  
  605. /* Report a fatal error. */
  606. #ifndef YY_FATAL_ERROR
  607. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  608. #endif
  609.  
  610. /* Default declaration of generated scanner - a define so the user can
  611.  * easily add parameters.
  612.  */
  613. #ifndef YY_DECL
  614. #define YY_DECL int yylex YY_PROTO(( void ))
  615. #endif
  616.  
  617. /* Code executed at the beginning of each rule, after yytext and yyleng
  618.  * have been set up.
  619.  */
  620. #ifndef YY_USER_ACTION
  621. #define YY_USER_ACTION
  622. #endif
  623.  
  624. /* Code executed at the end of each rule. */
  625. #ifndef YY_BREAK
  626. #define YY_BREAK break;
  627. #endif
  628.  
  629. #define YY_RULE_SETUP \
  630.     if ( yyleng > 0 ) \
  631.         yy_current_buffer->yy_at_bol = \
  632.                 (yytext[yyleng - 1] == '\n'); \
  633.     YY_USER_ACTION
  634.  
  635. YY_DECL
  636.     {
  637.     register yy_state_type yy_current_state;
  638.     register char *yy_cp, *yy_bp;
  639.     register int yy_act;
  640.  
  641. #line 27 "tg.l"
  642.  
  643.  
  644.  
  645. #line 646 "lex.yy.c"
  646.  
  647.     if ( yy_init )
  648.         {
  649.         yy_init = 0;
  650.  
  651. #ifdef YY_USER_INIT
  652.         YY_USER_INIT;
  653. #endif
  654.  
  655.         if ( ! yy_start )
  656.             yy_start = 1;    /* first start state */
  657.  
  658.         if ( ! yyin )
  659.             yyin = stdin;
  660.  
  661.         if ( ! yyout )
  662.             yyout = stdout;
  663.  
  664.         if ( ! yy_current_buffer )
  665.             yy_current_buffer =
  666.                 yy_create_buffer( yyin, YY_BUF_SIZE );
  667.  
  668.         yy_load_buffer_state();
  669.         }
  670.  
  671.     while ( 1 )        /* loops until end-of-file is reached */
  672.         {
  673.         yy_cp = yy_c_buf_p;
  674.  
  675.         /* Support of yytext. */
  676.         *yy_cp = yy_hold_char;
  677.  
  678.         /* yy_bp points to the position in yy_ch_buf of the start of
  679.          * the current run.
  680.          */
  681.         yy_bp = yy_cp;
  682.  
  683.         yy_current_state = yy_start;
  684.         yy_current_state += YY_AT_BOL();
  685. yy_match:
  686.         do
  687.             {
  688.             register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  689.             if ( yy_accept[yy_current_state] )
  690.                 {
  691.                 yy_last_accepting_state = yy_current_state;
  692.                 yy_last_accepting_cpos = yy_cp;
  693.                 }
  694.             while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  695.                 {
  696.                 yy_current_state = (int) yy_def[yy_current_state];
  697.                 if ( yy_current_state >= 151 )
  698.                     yy_c = yy_meta[(unsigned int) yy_c];
  699.                 }
  700.             yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  701.             ++yy_cp;
  702.             }
  703.         while ( yy_base[yy_current_state] != 185 );
  704.  
  705. yy_find_action:
  706.         yy_act = yy_accept[yy_current_state];
  707.         if ( yy_act == 0 )
  708.             { /* have to back up */
  709.             yy_cp = yy_last_accepting_cpos;
  710.             yy_current_state = yy_last_accepting_state;
  711.             yy_act = yy_accept[yy_current_state];
  712.             }
  713.  
  714.         YY_DO_BEFORE_ACTION;
  715.  
  716.  
  717. do_action:    /* This label is used only to access EOF actions. */
  718.  
  719.  
  720.         switch ( yy_act )
  721.     { /* beginning of action switch */
  722.             case 0: /* must back up */
  723.             /* undo the effects of YY_DO_BEFORE_ACTION */
  724.             *yy_cp = yy_hold_char;
  725.             yy_cp = yy_last_accepting_cpos;
  726.             yy_current_state = yy_last_accepting_state;
  727.             goto yy_find_action;
  728.  
  729. case 1:
  730. YY_RULE_SETUP
  731. #line 30 "tg.l"
  732. {  dprintf( "ESC(%c)\n", yytext[1]); 
  733.                   SETYYLVAL( yylval.i );
  734.                   yylval.i.val=yytext[1]; 
  735.                   return TOK_CHAR; }
  736.     YY_BREAK
  737. case 2:
  738. YY_RULE_SETUP
  739. #line 34 "tg.l"
  740. {  yylval.i.val = atoi( yytext ); 
  741.                   SETYYLVAL( yylval.i );
  742.                   dprintf("int(%d)\n", yylval.i.val);  
  743.                   return TOK_NUM; }
  744.     YY_BREAK
  745. case 3:
  746. YY_RULE_SETUP
  747. #line 38 "tg.l"
  748. {  yylval.f.val = atof( yytext ); 
  749.                   SETYYLVAL( yylval.f );
  750.                   dprintf("num(%f)\n", yylval.f.val);  
  751.                   return TOK_FLOAT; }
  752.     YY_BREAK
  753. case 4:
  754. YY_RULE_SETUP
  755. #line 42 "tg.l"
  756. {  
  757.                   SETYYLVAL( yylval.i );
  758.                   return TOK_IN; }
  759.     YY_BREAK
  760. case 5:
  761. YY_RULE_SETUP
  762. #line 45 "tg.l"
  763. { yylval.s.val = STRDUP( yytext ); 
  764.                               SETYYLVAL( yylval.s );
  765.                               dprintf("name '%s'\n",yytext);  
  766.                               return TOK_NAME; }
  767.     YY_BREAK
  768. case 6:
  769. YY_RULE_SETUP
  770. #line 49 "tg.l"
  771. {  SETYYLVAL( yylval.s ); }
  772.     YY_BREAK
  773. case 7:
  774. YY_RULE_SETUP
  775. #line 50 "tg.l"
  776. {  SETYYLVAL( yylval.s );  /* line continuation */
  777.                   lineno++; charno=0;  }
  778.     YY_BREAK
  779. case 8:
  780. YY_RULE_SETUP
  781. #line 52 "tg.l"
  782. {  SETYYLVAL( yylval.s );  /* #-comment */
  783.                   tt_store( text_table, lineno );
  784.                   lineno++; charno=0; 
  785.                   return TOK_NL; }
  786.     YY_BREAK
  787. case 9:
  788. YY_RULE_SETUP
  789. #line 56 "tg.l"
  790. {  yylval.s.val = STRDUP( yytext );
  791.                   SETYYLVAL( yylval.s );
  792.                   dprintf( "%s", yytext ); return TOK_STRING; }
  793.     YY_BREAK
  794. case 10:
  795. YY_RULE_SETUP
  796. #line 59 "tg.l"
  797. {  yylval.s.val = STRDUP( yytext );
  798.                   SETYYLVAL( yylval.s );
  799.                   dprintf( "%s", yytext ); return TOK_STRING; }
  800.     YY_BREAK
  801. case 11:
  802. YY_RULE_SETUP
  803. #line 63 "tg.l"
  804. {  STORETEXT();
  805.                   yylval.i.line=lineno; return TOK_AT; } 
  806.     YY_BREAK
  807. case 12:
  808. YY_RULE_SETUP
  809. #line 65 "tg.l"
  810. {  
  811.                   SETYYLVAL( yylval.s );
  812.                   return TOK_DOL;  }                 
  813.     YY_BREAK
  814. case 13:
  815. YY_RULE_SETUP
  816. #line 68 "tg.l"
  817. {  
  818.                   SETYYLVAL( yylval.s );
  819.                   return TOK_DOT;  }
  820.     YY_BREAK
  821. case 14:
  822. YY_RULE_SETUP
  823. #line 71 "tg.l"
  824. {  
  825.                   SETYYLVAL( yylval.s );
  826.                   return TOK_COM;  }
  827.     YY_BREAK
  828. case 15:
  829. YY_RULE_SETUP
  830. #line 74 "tg.l"
  831. {  
  832.                   SETYYLVAL( yylval.i );
  833.                   return TOK_EQEQ;  }
  834.     YY_BREAK
  835. case 16:
  836. YY_RULE_SETUP
  837. #line 77 "tg.l"
  838. {  
  839.                   SETYYLVAL( yylval.i );
  840.                   return TOK_NE;  }
  841.     YY_BREAK
  842. case 17:
  843. YY_RULE_SETUP
  844. #line 80 "tg.l"
  845. {  
  846.                   SETYYLVAL( yylval.i );
  847.                   return TOK_EQ;  }
  848.     YY_BREAK
  849. case 18:
  850. YY_RULE_SETUP
  851. #line 83 "tg.l"
  852. {  
  853.                   SETYYLVAL( yylval.i );
  854.                   return TOK_LT;  }
  855.     YY_BREAK
  856. case 19:
  857. YY_RULE_SETUP
  858. #line 86 "tg.l"
  859. {  
  860.                   SETYYLVAL( yylval.i );
  861.                   return TOK_GT;  }
  862.     YY_BREAK
  863. case 20:
  864. YY_RULE_SETUP
  865. #line 89 "tg.l"
  866. {  
  867.                   SETYYLVAL( yylval.i );
  868.                   return TOK_LTEQ;  }
  869.     YY_BREAK
  870. case 21:
  871. YY_RULE_SETUP
  872. #line 92 "tg.l"
  873. {  
  874.                   SETYYLVAL( yylval.i );
  875.                   return TOK_GTEQ;  }
  876.     YY_BREAK
  877. case 22:
  878. YY_RULE_SETUP
  879. #line 95 "tg.l"
  880. {  
  881.                   SETYYLVAL( yylval.i );
  882.                   return TOK_NOT;   }
  883.     YY_BREAK
  884. case 23:
  885. YY_RULE_SETUP
  886. #line 98 "tg.l"
  887. {  
  888.                   SETYYLVAL( yylval.s );
  889.                   return TOK_STAR;  }
  890.     YY_BREAK
  891. case 24:
  892. YY_RULE_SETUP
  893. #line 101 "tg.l"
  894. {  
  895.                   SETYYLVAL( yylval.s );
  896.                   return TOK_PLUS;  }
  897.     YY_BREAK
  898. case 25:
  899. YY_RULE_SETUP
  900. #line 104 "tg.l"
  901. {  
  902.                   SETYYLVAL( yylval.s );
  903.                   return TOK_MINUS;  }
  904.     YY_BREAK
  905. case 26:
  906. YY_RULE_SETUP
  907. #line 107 "tg.l"
  908. {  
  909.                   SETYYLVAL( yylval.s );
  910.                   return TOK_DIV;  }
  911.     YY_BREAK
  912. case 27:
  913. YY_RULE_SETUP
  914. #line 110 "tg.l"
  915. {  
  916.                   SETYYLVAL( yylval.s );
  917.                   return TOK_MUL_S; }
  918.     YY_BREAK
  919. case 28:
  920. YY_RULE_SETUP
  921. #line 113 "tg.l"
  922. {  
  923.                   SETYYLVAL( yylval.s );
  924.                   return TOK_PLUS_S; }
  925.     YY_BREAK
  926. case 29:
  927. YY_RULE_SETUP
  928. #line 116 "tg.l"
  929. {  
  930.                   SETYYLVAL( yylval.s );
  931.                   return TOK_MINUS_S;  }
  932.     YY_BREAK
  933. case 30:
  934. YY_RULE_SETUP
  935. #line 119 "tg.l"
  936. {  
  937.                   SETYYLVAL( yylval.s );
  938.                   return TOK_DIV_S;  }
  939.     YY_BREAK
  940. case 31:
  941. YY_RULE_SETUP
  942. #line 122 "tg.l"
  943. {  
  944.                   SETYYLVAL( yylval.s );
  945.                   return TOK_PLUSPLUS;  }
  946.     YY_BREAK
  947. case 32:
  948. YY_RULE_SETUP
  949. #line 125 "tg.l"
  950. {  
  951.                   SETYYLVAL( yylval.s );
  952.                   return TOK_MINUSMINUS;  }
  953.     YY_BREAK
  954. case 33:
  955. YY_RULE_SETUP
  956. #line 128 "tg.l"
  957. {  
  958.                   SETYYLVAL( yylval.s );
  959.                   return TOK_OR; }
  960.     YY_BREAK
  961. case 34:
  962. YY_RULE_SETUP
  963. #line 131 "tg.l"
  964. {  
  965.                   SETYYLVAL( yylval.s );
  966.                   return TOK_AND; }
  967.     YY_BREAK
  968. case 35:
  969. YY_RULE_SETUP
  970. #line 134 "tg.l"
  971. {  
  972.                   SETYYLVAL( yylval.s );
  973.                   return TOK_OPEN;  }
  974.     YY_BREAK
  975. case 36:
  976. YY_RULE_SETUP
  977. #line 137 "tg.l"
  978. {  
  979.                   SETYYLVAL( yylval.s );
  980.                   return TOK_CLOSE;  }
  981.     YY_BREAK
  982. case 37:
  983. YY_RULE_SETUP
  984. #line 140 "tg.l"
  985. {  
  986.                   SETYYLVAL( yylval.s );
  987.                   return TOK_OPENB;  }
  988.     YY_BREAK
  989. case 38:
  990. YY_RULE_SETUP
  991. #line 143 "tg.l"
  992. {  
  993.                   SETYYLVAL( yylval.s );
  994.                   return TOK_CLOSEB;  }
  995.     YY_BREAK
  996. case 39:
  997. YY_RULE_SETUP
  998. #line 146 "tg.l"
  999. {  
  1000.                   SETYYLVAL( yylval.i );
  1001.                   return TOK_COLON;  }
  1002.     YY_BREAK
  1003. case 40:
  1004. YY_RULE_SETUP
  1005. #line 149 "tg.l"
  1006. {  
  1007.                   SETYYLVAL( yylval.i );
  1008.                   return TOK_SCOL;   }
  1009.     YY_BREAK
  1010. case 41:
  1011. YY_RULE_SETUP
  1012. #line 152 "tg.l"
  1013. {  
  1014.                   SETYYLVAL( yylval.s );
  1015.                   tt_store( text_table, lineno );
  1016.                   lineno++; charno=0; 
  1017.                   return TOK_NL; }
  1018.     YY_BREAK
  1019. case 42:
  1020. YY_RULE_SETUP
  1021. #line 157 "tg.l"
  1022.                   SETYYLVAL( yylval.i );
  1023.                   yylval.i.val=yytext[0]; 
  1024.                /* printf( "CHAR: %d\n", yytext[0] ); */
  1025.                   return TOK_CHAR; }
  1026.     YY_BREAK
  1027. case 43:
  1028. YY_RULE_SETUP
  1029. #line 162 "tg.l"
  1030. { STORETEXT(); yylval.i.line=lineno; return TOK_IF; }    
  1031.     YY_BREAK
  1032. case 44:
  1033. YY_RULE_SETUP
  1034. #line 163 "tg.l"
  1035. { STORETEXT(); yylval.i.line=lineno; return TOK_ELSE; }    
  1036.     YY_BREAK
  1037. case 45:
  1038. YY_RULE_SETUP
  1039. #line 164 "tg.l"
  1040. { STORETEXT(); yylval.i.line=lineno; return TOK_ENDIF; }   
  1041.     YY_BREAK
  1042. case 46:
  1043. YY_RULE_SETUP
  1044. #line 165 "tg.l"
  1045. { STORETEXT(); yylval.i.line=lineno; return TOK_EMBED; }   
  1046.     YY_BREAK
  1047. case 47:
  1048. YY_RULE_SETUP
  1049. #line 166 "tg.l"
  1050. { STORETEXT(); yylval.i.line=lineno; return TOK_EMIT; }  
  1051.     YY_BREAK
  1052. case 48:
  1053. YY_RULE_SETUP
  1054. #line 167 "tg.l"
  1055. { STORETEXT(); yylval.i.line=lineno; return TOK_FUNCTION; }
  1056.     YY_BREAK
  1057. case 49:
  1058. YY_RULE_SETUP
  1059. #line 168 "tg.l"
  1060. { STORETEXT(); yylval.i.line=lineno; return TOK_ENDFUNCTION; }
  1061.     YY_BREAK
  1062. case 50:
  1063. YY_RULE_SETUP
  1064. #line 169 "tg.l"
  1065. { STORETEXT(); yylval.i.line=lineno; return TOK_SWITCH; }
  1066.     YY_BREAK
  1067. case 51:
  1068. YY_RULE_SETUP
  1069. #line 170 "tg.l"
  1070. { STORETEXT(); yylval.i.line=lineno; return TOK_CASE; }
  1071.     YY_BREAK
  1072. case 52:
  1073. YY_RULE_SETUP
  1074. #line 171 "tg.l"
  1075. { STORETEXT(); yylval.i.line=lineno; return TOK_FOR; }
  1076.     YY_BREAK
  1077. case 53:
  1078. YY_RULE_SETUP
  1079. #line 172 "tg.l"
  1080. { STORETEXT(); yylval.i.line=lineno; return TOK_ENDSWITCH;}
  1081.     YY_BREAK
  1082. case 54:
  1083. YY_RULE_SETUP
  1084. #line 173 "tg.l"
  1085. { STORETEXT(); yylval.i.line=lineno; return TOK_ENDFOR; }
  1086.     YY_BREAK
  1087. case 55:
  1088. YY_RULE_SETUP
  1089. #line 174 "tg.l"
  1090. { STORETEXT(); yylval.i.line=lineno; return TOK_RETURN; }
  1091.     YY_BREAK
  1092. case 56:
  1093. YY_RULE_SETUP
  1094. #line 175 "tg.l"
  1095. { STORETEXT(); yylval.i.line=lineno; return TOK_BREAK; }
  1096.     YY_BREAK
  1097. case 57:
  1098. YY_RULE_SETUP
  1099. #line 176 "tg.l"
  1100. { STORETEXT(); yylval.i.line=lineno; return TOK_PUSH; }
  1101.     YY_BREAK
  1102. case 58:
  1103. YY_RULE_SETUP
  1104. #line 177 "tg.l"
  1105. { STORETEXT(); yylval.i.line=lineno; return TOK_POP; }
  1106.     YY_BREAK
  1107. case 59:
  1108. YY_RULE_SETUP
  1109. #line 178 "tg.l"
  1110. { STORETEXT(); yylval.i.line=lineno; return TOK_OUTPUT; }
  1111.     YY_BREAK
  1112. case 60:
  1113. YY_RULE_SETUP
  1114. #line 179 "tg.l"
  1115. { STORETEXT(); yylval.i.line=lineno; return TOK_LOCAL; }
  1116.     YY_BREAK
  1117. case 61:
  1118. YY_RULE_SETUP
  1119. #line 180 "tg.l"
  1120. { STORETEXT(); yylval.i.line=lineno; return TOK_USE; }
  1121.     YY_BREAK
  1122. case 62:
  1123. YY_RULE_SETUP
  1124. #line 181 "tg.l"
  1125. { STORETEXT(); yylval.i.line=lineno; return TOK_EXIT; }
  1126.     YY_BREAK
  1127. case 63:
  1128. YY_RULE_SETUP
  1129. #line 183 "tg.l"
  1130. ECHO;
  1131.     YY_BREAK
  1132. #line 1134 "lex.yy.c"
  1133. case YY_STATE_EOF(INITIAL):
  1134.     yyterminate();
  1135.  
  1136.     case YY_END_OF_BUFFER:
  1137.         {
  1138.         /* Amount of text matched not including the EOB char. */
  1139.         int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
  1140.  
  1141.         /* Undo the effects of YY_DO_BEFORE_ACTION. */
  1142.         *yy_cp = yy_hold_char;
  1143.         YY_RESTORE_YY_MORE_OFFSET
  1144.  
  1145.         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
  1146.             {
  1147.             /* We're scanning a new file or input source.  It's
  1148.              * possible that this happened because the user
  1149.              * just pointed yyin at a new source and called
  1150.              * yylex().  If so, then we have to assure
  1151.              * consistency between yy_current_buffer and our
  1152.              * globals.  Here is the right place to do so, because
  1153.              * this is the first action (other than possibly a
  1154.              * back-up) that will match for the new input source.
  1155.              */
  1156.             yy_n_chars = yy_current_buffer->yy_n_chars;
  1157.             yy_current_buffer->yy_input_file = yyin;
  1158.             yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
  1159.             }
  1160.  
  1161.         /* Note that here we test for yy_c_buf_p "<=" to the position
  1162.          * of the first EOB in the buffer, since yy_c_buf_p will
  1163.          * already have been incremented past the NUL character
  1164.          * (since all states make transitions on EOB to the
  1165.          * end-of-buffer state).  Contrast this with the test
  1166.          * in input().
  1167.          */
  1168.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1169.             { /* This was really a NUL. */
  1170.             yy_state_type yy_next_state;
  1171.  
  1172.             yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
  1173.  
  1174.             yy_current_state = yy_get_previous_state();
  1175.  
  1176.             /* Okay, we're now positioned to make the NUL
  1177.              * transition.  We couldn't have
  1178.              * yy_get_previous_state() go ahead and do it
  1179.              * for us because it doesn't know how to deal
  1180.              * with the possibility of jamming (and we don't
  1181.              * want to build jamming into it because then it
  1182.              * will run more slowly).
  1183.              */
  1184.  
  1185.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  1186.  
  1187.             yy_bp = yytext_ptr + YY_MORE_ADJ;
  1188.  
  1189.             if ( yy_next_state )
  1190.                 {
  1191.                 /* Consume the NUL. */
  1192.                 yy_cp = ++yy_c_buf_p;
  1193.                 yy_current_state = yy_next_state;
  1194.                 goto yy_match;
  1195.                 }
  1196.  
  1197.             else
  1198.                 {
  1199.                 yy_cp = yy_c_buf_p;
  1200.                 goto yy_find_action;
  1201.                 }
  1202.             }
  1203.  
  1204.         else switch ( yy_get_next_buffer() )
  1205.             {
  1206.             case EOB_ACT_END_OF_FILE:
  1207.                 {
  1208.                 yy_did_buffer_switch_on_eof = 0;
  1209.  
  1210.                 if ( yywrap() )
  1211.                     {
  1212.                     /* Note: because we've taken care in
  1213.                      * yy_get_next_buffer() to have set up
  1214.                      * yytext, we can now set up
  1215.                      * yy_c_buf_p so that if some total
  1216.                      * hoser (like flex itself) wants to
  1217.                      * call the scanner after we return the
  1218.                      * YY_NULL, it'll still work - another
  1219.                      * YY_NULL will get returned.
  1220.                      */
  1221.                     yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
  1222.  
  1223.                     yy_act = YY_STATE_EOF(YY_START);
  1224.                     goto do_action;
  1225.                     }
  1226.  
  1227.                 else
  1228.                     {
  1229.                     if ( ! yy_did_buffer_switch_on_eof )
  1230.                         YY_NEW_FILE;
  1231.                     }
  1232.                 break;
  1233.                 }
  1234.  
  1235.             case EOB_ACT_CONTINUE_SCAN:
  1236.                 yy_c_buf_p =
  1237.                     yytext_ptr + yy_amount_of_matched_text;
  1238.  
  1239.                 yy_current_state = yy_get_previous_state();
  1240.  
  1241.                 yy_cp = yy_c_buf_p;
  1242.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  1243.                 goto yy_match;
  1244.  
  1245.             case EOB_ACT_LAST_MATCH:
  1246.                 yy_c_buf_p =
  1247.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  1248.  
  1249.                 yy_current_state = yy_get_previous_state();
  1250.  
  1251.                 yy_cp = yy_c_buf_p;
  1252.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  1253.                 goto yy_find_action;
  1254.             }
  1255.         break;
  1256.         }
  1257.  
  1258.     default:
  1259.         YY_FATAL_ERROR(
  1260.             "fatal flex scanner internal error--no action found" );
  1261.     } /* end of action switch */
  1262.         } /* end of scanning one token */
  1263.     } /* end of yylex */
  1264.  
  1265.  
  1266. /* yy_get_next_buffer - try to read in a new buffer
  1267.  *
  1268.  * Returns a code representing an action:
  1269.  *    EOB_ACT_LAST_MATCH -
  1270.  *    EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1271.  *    EOB_ACT_END_OF_FILE - end of file
  1272.  */
  1273.  
  1274. static int yy_get_next_buffer()
  1275.     {
  1276.     register char *dest = yy_current_buffer->yy_ch_buf;
  1277.     register char *source = yytext_ptr;
  1278.     register int number_to_move, i;
  1279.     int ret_val;
  1280.  
  1281.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  1282.         YY_FATAL_ERROR(
  1283.         "fatal flex scanner internal error--end of buffer missed" );
  1284.  
  1285.     if ( yy_current_buffer->yy_fill_buffer == 0 )
  1286.         { /* Don't try to fill the buffer, so this is an EOF. */
  1287.         if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
  1288.             {
  1289.             /* We matched a single character, the EOB, so
  1290.              * treat this as a final EOF.
  1291.              */
  1292.             return EOB_ACT_END_OF_FILE;
  1293.             }
  1294.  
  1295.         else
  1296.             {
  1297.             /* We matched some text prior to the EOB, first
  1298.              * process it.
  1299.              */
  1300.             return EOB_ACT_LAST_MATCH;
  1301.             }
  1302.         }
  1303.  
  1304.     /* Try to read more data. */
  1305.  
  1306.     /* First move last chars to start of buffer. */
  1307.     number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
  1308.  
  1309.     for ( i = 0; i < number_to_move; ++i )
  1310.         *(dest++) = *(source++);
  1311.  
  1312.     if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1313.         /* don't do the read, it's not guaranteed to return an EOF,
  1314.          * just force an EOF
  1315.          */
  1316.         yy_current_buffer->yy_n_chars = yy_n_chars = 0;
  1317.  
  1318.     else
  1319.         {
  1320.         int num_to_read =
  1321.             yy_current_buffer->yy_buf_size - number_to_move - 1;
  1322.  
  1323.         while ( num_to_read <= 0 )
  1324.             { /* Not enough room in the buffer - grow it. */
  1325. #ifdef YY_USES_REJECT
  1326.             YY_FATAL_ERROR(
  1327. "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
  1328. #else
  1329.  
  1330.             /* just a shorter name for the current buffer */
  1331.             YY_BUFFER_STATE b = yy_current_buffer;
  1332.  
  1333.             int yy_c_buf_p_offset =
  1334.                 (int) (yy_c_buf_p - b->yy_ch_buf);
  1335.  
  1336.             if ( b->yy_is_our_buffer )
  1337.                 {
  1338.                 int new_size = b->yy_buf_size * 2;
  1339.  
  1340.                 if ( new_size <= 0 )
  1341.                     b->yy_buf_size += b->yy_buf_size / 8;
  1342.                 else
  1343.                     b->yy_buf_size *= 2;
  1344.  
  1345.                 b->yy_ch_buf = (char *)
  1346.                     /* Include room in for 2 EOB chars. */
  1347.                     yy_flex_realloc( (void *) b->yy_ch_buf,
  1348.                              b->yy_buf_size + 2 );
  1349.                 }
  1350.             else
  1351.                 /* Can't grow it, we don't own it. */
  1352.                 b->yy_ch_buf = 0;
  1353.  
  1354.             if ( ! b->yy_ch_buf )
  1355.                 YY_FATAL_ERROR(
  1356.                 "fatal error - scanner input buffer overflow" );
  1357.  
  1358.             yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  1359.  
  1360.             num_to_read = yy_current_buffer->yy_buf_size -
  1361.                         number_to_move - 1;
  1362. #endif
  1363.             }
  1364.  
  1365.         if ( num_to_read > YY_READ_BUF_SIZE )
  1366.             num_to_read = YY_READ_BUF_SIZE;
  1367.  
  1368.         /* Read in more data. */
  1369.         YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  1370.             yy_n_chars, num_to_read );
  1371.  
  1372.         yy_current_buffer->yy_n_chars = yy_n_chars;
  1373.         }
  1374.  
  1375.     if ( yy_n_chars == 0 )
  1376.         {
  1377.         if ( number_to_move == YY_MORE_ADJ )
  1378.             {
  1379.             ret_val = EOB_ACT_END_OF_FILE;
  1380.             yyrestart( yyin );
  1381.             }
  1382.  
  1383.         else
  1384.             {
  1385.             ret_val = EOB_ACT_LAST_MATCH;
  1386.             yy_current_buffer->yy_buffer_status =
  1387.                 YY_BUFFER_EOF_PENDING;
  1388.             }
  1389.         }
  1390.  
  1391.     else
  1392.         ret_val = EOB_ACT_CONTINUE_SCAN;
  1393.  
  1394.     yy_n_chars += number_to_move;
  1395.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1396.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1397.  
  1398.     yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
  1399.  
  1400.     return ret_val;
  1401.     }
  1402.  
  1403.  
  1404. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1405.  
  1406. static yy_state_type yy_get_previous_state()
  1407.     {
  1408.     register yy_state_type yy_current_state;
  1409.     register char *yy_cp;
  1410.  
  1411.     yy_current_state = yy_start;
  1412.     yy_current_state += YY_AT_BOL();
  1413.  
  1414.     for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  1415.         {
  1416.         register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1417.         if ( yy_accept[yy_current_state] )
  1418.             {
  1419.             yy_last_accepting_state = yy_current_state;
  1420.             yy_last_accepting_cpos = yy_cp;
  1421.             }
  1422.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1423.             {
  1424.             yy_current_state = (int) yy_def[yy_current_state];
  1425.             if ( yy_current_state >= 151 )
  1426.                 yy_c = yy_meta[(unsigned int) yy_c];
  1427.             }
  1428.         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1429.         }
  1430.  
  1431.     return yy_current_state;
  1432.     }
  1433.  
  1434.  
  1435. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1436.  *
  1437.  * synopsis
  1438.  *    next_state = yy_try_NUL_trans( current_state );
  1439.  */
  1440.  
  1441. #ifdef YY_USE_PROTOS
  1442. static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
  1443. #else
  1444. static yy_state_type yy_try_NUL_trans( yy_current_state )
  1445. yy_state_type yy_current_state;
  1446. #endif
  1447.     {
  1448.     register int yy_is_jam;
  1449.     register char *yy_cp = yy_c_buf_p;
  1450.  
  1451.     register YY_CHAR yy_c = 1;
  1452.     if ( yy_accept[yy_current_state] )
  1453.         {
  1454.         yy_last_accepting_state = yy_current_state;
  1455.         yy_last_accepting_cpos = yy_cp;
  1456.         }
  1457.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1458.         {
  1459.         yy_current_state = (int) yy_def[yy_current_state];
  1460.         if ( yy_current_state >= 151 )
  1461.             yy_c = yy_meta[(unsigned int) yy_c];
  1462.         }
  1463.     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1464.     yy_is_jam = (yy_current_state == 150);
  1465.  
  1466.     return yy_is_jam ? 0 : yy_current_state;
  1467.     }
  1468.  
  1469.  
  1470. #ifndef YY_NO_UNPUT
  1471. #ifdef YY_USE_PROTOS
  1472. static void yyunput( int c, register char *yy_bp )
  1473. #else
  1474. static void yyunput( c, yy_bp )
  1475. int c;
  1476. register char *yy_bp;
  1477. #endif
  1478.     {
  1479.     register char *yy_cp = yy_c_buf_p;
  1480.  
  1481.     /* undo effects of setting up yytext */
  1482.     *yy_cp = yy_hold_char;
  1483.  
  1484.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1485.         { /* need to shift things up to make room */
  1486.         /* +2 for EOB chars. */
  1487.         register int number_to_move = yy_n_chars + 2;
  1488.         register char *dest = &yy_current_buffer->yy_ch_buf[
  1489.                     yy_current_buffer->yy_buf_size + 2];
  1490.         register char *source =
  1491.                 &yy_current_buffer->yy_ch_buf[number_to_move];
  1492.  
  1493.         while ( source > yy_current_buffer->yy_ch_buf )
  1494.             *--dest = *--source;
  1495.  
  1496.         yy_cp += (int) (dest - source);
  1497.         yy_bp += (int) (dest - source);
  1498.         yy_current_buffer->yy_n_chars =
  1499.             yy_n_chars = yy_current_buffer->yy_buf_size;
  1500.  
  1501.         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1502.             YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1503.         }
  1504.  
  1505.     *--yy_cp = (char) c;
  1506.  
  1507.  
  1508.     yytext_ptr = yy_bp;
  1509.     yy_hold_char = *yy_cp;
  1510.     yy_c_buf_p = yy_cp;
  1511.     }
  1512. #endif    /* ifndef YY_NO_UNPUT */
  1513.  
  1514.  
  1515. #ifdef __cplusplus
  1516. static int yyinput()
  1517. #else
  1518. static int input()
  1519. #endif
  1520.     {
  1521.     int c;
  1522.  
  1523.     *yy_c_buf_p = yy_hold_char;
  1524.  
  1525.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1526.         {
  1527.         /* yy_c_buf_p now points to the character we want to return.
  1528.          * If this occurs *before* the EOB characters, then it's a
  1529.          * valid NUL; if not, then we've hit the end of the buffer.
  1530.          */
  1531.         if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1532.             /* This was really a NUL. */
  1533.             *yy_c_buf_p = '\0';
  1534.  
  1535.         else
  1536.             { /* need more input */
  1537.             int offset = yy_c_buf_p - yytext_ptr;
  1538.             ++yy_c_buf_p;
  1539.  
  1540.             switch ( yy_get_next_buffer() )
  1541.                 {
  1542.                 case EOB_ACT_LAST_MATCH:
  1543.                     /* This happens because yy_g_n_b()
  1544.                      * sees that we've accumulated a
  1545.                      * token and flags that we need to
  1546.                      * try matching the token before
  1547.                      * proceeding.  But for input(),
  1548.                      * there's no matching to consider.
  1549.                      * So convert the EOB_ACT_LAST_MATCH
  1550.                      * to EOB_ACT_END_OF_FILE.
  1551.                      */
  1552.  
  1553.                     /* Reset buffer status. */
  1554.                     yyrestart( yyin );
  1555.  
  1556.                     /* fall through */
  1557.  
  1558.                 case EOB_ACT_END_OF_FILE:
  1559.                     {
  1560.                     if ( yywrap() )
  1561.                         return EOF;
  1562.  
  1563.                     if ( ! yy_did_buffer_switch_on_eof )
  1564.                         YY_NEW_FILE;
  1565. #ifdef __cplusplus
  1566.                     return yyinput();
  1567. #else
  1568.                     return input();
  1569. #endif
  1570.                     }
  1571.  
  1572.                 case EOB_ACT_CONTINUE_SCAN:
  1573.                     yy_c_buf_p = yytext_ptr + offset;
  1574.                     break;
  1575.                 }
  1576.             }
  1577.         }
  1578.  
  1579.     c = *(unsigned char *) yy_c_buf_p;    /* cast for 8-bit char's */
  1580.     *yy_c_buf_p = '\0';    /* preserve yytext */
  1581.     yy_hold_char = *++yy_c_buf_p;
  1582.  
  1583.     yy_current_buffer->yy_at_bol = (c == '\n');
  1584.  
  1585.     return c;
  1586.     }
  1587.  
  1588.  
  1589. #ifdef YY_USE_PROTOS
  1590. void yyrestart( FILE *input_file )
  1591. #else
  1592. void yyrestart( input_file )
  1593. FILE *input_file;
  1594. #endif
  1595.     {
  1596.     if ( ! yy_current_buffer )
  1597.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  1598.  
  1599.     yy_init_buffer( yy_current_buffer, input_file );
  1600.     yy_load_buffer_state();
  1601.     }
  1602.  
  1603.  
  1604. #ifdef YY_USE_PROTOS
  1605. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1606. #else
  1607. void yy_switch_to_buffer( new_buffer )
  1608. YY_BUFFER_STATE new_buffer;
  1609. #endif
  1610.     {
  1611.     if ( yy_current_buffer == new_buffer )
  1612.         return;
  1613.  
  1614.     if ( yy_current_buffer )
  1615.         {
  1616.         /* Flush out information for old buffer. */
  1617.         *yy_c_buf_p = yy_hold_char;
  1618.         yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1619.         yy_current_buffer->yy_n_chars = yy_n_chars;
  1620.         }
  1621.  
  1622.     yy_current_buffer = new_buffer;
  1623.     yy_load_buffer_state();
  1624.  
  1625.     /* We don't actually know whether we did this switch during
  1626.      * EOF (yywrap()) processing, but the only time this flag
  1627.      * is looked at is after yywrap() is called, so it's safe
  1628.      * to go ahead and always set it.
  1629.      */
  1630.     yy_did_buffer_switch_on_eof = 1;
  1631.     }
  1632.  
  1633.  
  1634. #ifdef YY_USE_PROTOS
  1635. void yy_load_buffer_state( void )
  1636. #else
  1637. void yy_load_buffer_state()
  1638. #endif
  1639.     {
  1640.     yy_n_chars = yy_current_buffer->yy_n_chars;
  1641.     yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  1642.     yyin = yy_current_buffer->yy_input_file;
  1643.     yy_hold_char = *yy_c_buf_p;
  1644.     }
  1645.  
  1646.  
  1647. #ifdef YY_USE_PROTOS
  1648. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  1649. #else
  1650. YY_BUFFER_STATE yy_create_buffer( file, size )
  1651. FILE *file;
  1652. int size;
  1653. #endif
  1654.     {
  1655.     YY_BUFFER_STATE b;
  1656.  
  1657.     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  1658.     if ( ! b )
  1659.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1660.  
  1661.     b->yy_buf_size = size;
  1662.  
  1663.     /* yy_ch_buf has to be 2 characters longer than the size given because
  1664.      * we need to put in 2 end-of-buffer characters.
  1665.      */
  1666.     b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
  1667.     if ( ! b->yy_ch_buf )
  1668.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1669.  
  1670.     b->yy_is_our_buffer = 1;
  1671.  
  1672.     yy_init_buffer( b, file );
  1673.  
  1674.     return b;
  1675.     }
  1676.  
  1677.  
  1678. #ifdef YY_USE_PROTOS
  1679. void yy_delete_buffer( YY_BUFFER_STATE b )
  1680. #else
  1681. void yy_delete_buffer( b )
  1682. YY_BUFFER_STATE b;
  1683. #endif
  1684.     {
  1685.     if ( ! b )
  1686.         return;
  1687.  
  1688.     if ( b == yy_current_buffer )
  1689.         yy_current_buffer = (YY_BUFFER_STATE) 0;
  1690.  
  1691.     if ( b->yy_is_our_buffer )
  1692.         yy_flex_free( (void *) b->yy_ch_buf );
  1693.  
  1694.     yy_flex_free( (void *) b );
  1695.     }
  1696.  
  1697.  
  1698. #ifndef YY_ALWAYS_INTERACTIVE
  1699. #ifndef YY_NEVER_INTERACTIVE
  1700. extern int isatty YY_PROTO(( int ));
  1701. #endif
  1702. #endif
  1703.  
  1704. #ifdef YY_USE_PROTOS
  1705. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  1706. #else
  1707. void yy_init_buffer( b, file )
  1708. YY_BUFFER_STATE b;
  1709. FILE *file;
  1710. #endif
  1711.  
  1712.  
  1713.     {
  1714.     yy_flush_buffer( b );
  1715.  
  1716.     b->yy_input_file = file;
  1717.     b->yy_fill_buffer = 1;
  1718.  
  1719. #if YY_ALWAYS_INTERACTIVE
  1720.     b->yy_is_interactive = 1;
  1721. #else
  1722. #if YY_NEVER_INTERACTIVE
  1723.     b->yy_is_interactive = 0;
  1724. #else
  1725.     b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1726. #endif
  1727. #endif
  1728.     }
  1729.  
  1730.  
  1731. #ifdef YY_USE_PROTOS
  1732. void yy_flush_buffer( YY_BUFFER_STATE b )
  1733. #else
  1734. void yy_flush_buffer( b )
  1735. YY_BUFFER_STATE b;
  1736. #endif
  1737.  
  1738.     {
  1739.     if ( ! b )
  1740.         return;
  1741.  
  1742.     b->yy_n_chars = 0;
  1743.  
  1744.     /* We always need two end-of-buffer characters.  The first causes
  1745.      * a transition to the end-of-buffer state.  The second causes
  1746.      * a jam in that state.
  1747.      */
  1748.     b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1749.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1750.  
  1751.     b->yy_buf_pos = &b->yy_ch_buf[0];
  1752.  
  1753.     b->yy_at_bol = 1;
  1754.     b->yy_buffer_status = YY_BUFFER_NEW;
  1755.  
  1756.     if ( b == yy_current_buffer )
  1757.         yy_load_buffer_state();
  1758.     }
  1759.  
  1760.  
  1761. #ifndef YY_NO_SCAN_BUFFER
  1762. #ifdef YY_USE_PROTOS
  1763. YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
  1764. #else
  1765. YY_BUFFER_STATE yy_scan_buffer( base, size )
  1766. char *base;
  1767. yy_size_t size;
  1768. #endif
  1769.     {
  1770.     YY_BUFFER_STATE b;
  1771.  
  1772.     if ( size < 2 ||
  1773.          base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1774.          base[size-1] != YY_END_OF_BUFFER_CHAR )
  1775.         /* They forgot to leave room for the EOB's. */
  1776.         return 0;
  1777.  
  1778.     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  1779.     if ( ! b )
  1780.         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1781.  
  1782.     b->yy_buf_size = size - 2;    /* "- 2" to take care of EOB's */
  1783.     b->yy_buf_pos = b->yy_ch_buf = base;
  1784.     b->yy_is_our_buffer = 0;
  1785.     b->yy_input_file = 0;
  1786.     b->yy_n_chars = b->yy_buf_size;
  1787.     b->yy_is_interactive = 0;
  1788.     b->yy_at_bol = 1;
  1789.     b->yy_fill_buffer = 0;
  1790.     b->yy_buffer_status = YY_BUFFER_NEW;
  1791.  
  1792.     yy_switch_to_buffer( b );
  1793.  
  1794.     return b;
  1795.     }
  1796. #endif
  1797.  
  1798.  
  1799. #ifndef YY_NO_SCAN_STRING
  1800. #ifdef YY_USE_PROTOS
  1801. YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
  1802. #else
  1803. YY_BUFFER_STATE yy_scan_string( yy_str )
  1804. yyconst char *yy_str;
  1805. #endif
  1806.     {
  1807.     int len;
  1808.     for ( len = 0; yy_str[len]; ++len )
  1809.         ;
  1810.  
  1811.     return yy_scan_bytes( yy_str, len );
  1812.     }
  1813. #endif
  1814.  
  1815.  
  1816. #ifndef YY_NO_SCAN_BYTES
  1817. #ifdef YY_USE_PROTOS
  1818. YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
  1819. #else
  1820. YY_BUFFER_STATE yy_scan_bytes( bytes, len )
  1821. yyconst char *bytes;
  1822. int len;
  1823. #endif
  1824.     {
  1825.     YY_BUFFER_STATE b;
  1826.     char *buf;
  1827.     yy_size_t n;
  1828.     int i;
  1829.  
  1830.     /* Get memory for full buffer, including space for trailing EOB's. */
  1831.     n = len + 2;
  1832.     buf = (char *) yy_flex_alloc( n );
  1833.     if ( ! buf )
  1834.         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1835.  
  1836.     for ( i = 0; i < len; ++i )
  1837.         buf[i] = bytes[i];
  1838.  
  1839.     buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
  1840.  
  1841.     b = yy_scan_buffer( buf, n );
  1842.     if ( ! b )
  1843.         YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1844.  
  1845.     /* It's okay to grow etc. this buffer, and we should throw it
  1846.      * away when we're done.
  1847.      */
  1848.     b->yy_is_our_buffer = 1;
  1849.  
  1850.     return b;
  1851.     }
  1852. #endif
  1853.  
  1854.  
  1855. #ifndef YY_NO_PUSH_STATE
  1856. #ifdef YY_USE_PROTOS
  1857. static void yy_push_state( int new_state )
  1858. #else
  1859. static void yy_push_state( new_state )
  1860. int new_state;
  1861. #endif
  1862.     {
  1863.     if ( yy_start_stack_ptr >= yy_start_stack_depth )
  1864.         {
  1865.         yy_size_t new_size;
  1866.  
  1867.         yy_start_stack_depth += YY_START_STACK_INCR;
  1868.         new_size = yy_start_stack_depth * sizeof( int );
  1869.  
  1870.         if ( ! yy_start_stack )
  1871.             yy_start_stack = (int *) yy_flex_alloc( new_size );
  1872.  
  1873.         else
  1874.             yy_start_stack = (int *) yy_flex_realloc(
  1875.                     (void *) yy_start_stack, new_size );
  1876.  
  1877.         if ( ! yy_start_stack )
  1878.             YY_FATAL_ERROR(
  1879.             "out of memory expanding start-condition stack" );
  1880.         }
  1881.  
  1882.     yy_start_stack[yy_start_stack_ptr++] = YY_START;
  1883.  
  1884.     BEGIN(new_state);
  1885.     }
  1886. #endif
  1887.  
  1888.  
  1889. #ifndef YY_NO_POP_STATE
  1890. static void yy_pop_state()
  1891.     {
  1892.     if ( --yy_start_stack_ptr < 0 )
  1893.         YY_FATAL_ERROR( "start-condition stack underflow" );
  1894.  
  1895.     BEGIN(yy_start_stack[yy_start_stack_ptr]);
  1896.     }
  1897. #endif
  1898.  
  1899.  
  1900. #ifndef YY_NO_TOP_STATE
  1901. static int yy_top_state()
  1902.     {
  1903.     return yy_start_stack[yy_start_stack_ptr - 1];
  1904.     }
  1905. #endif
  1906.  
  1907. #ifndef YY_EXIT_FAILURE
  1908. #define YY_EXIT_FAILURE 2
  1909. #endif
  1910.  
  1911. #ifdef YY_USE_PROTOS
  1912. static void yy_fatal_error( yyconst char msg[] )
  1913. #else
  1914. static void yy_fatal_error( msg )
  1915. char msg[];
  1916. #endif
  1917.     {
  1918.     (void) fprintf( stderr, "%s\n", msg );
  1919.     exit( YY_EXIT_FAILURE );
  1920.     }
  1921.  
  1922.  
  1923.  
  1924. /* Redefine yyless() so it works in section 3 code. */
  1925.  
  1926. #undef yyless
  1927. #define yyless(n) \
  1928.     do \
  1929.         { \
  1930.         /* Undo effects of setting up yytext. */ \
  1931.         yytext[yyleng] = yy_hold_char; \
  1932.         yy_c_buf_p = yytext + n; \
  1933.         yy_hold_char = *yy_c_buf_p; \
  1934.         *yy_c_buf_p = '\0'; \
  1935.         yyleng = n; \
  1936.         } \
  1937.     while ( 0 )
  1938.  
  1939.  
  1940. /* Internal utility routines. */
  1941.  
  1942. #ifndef yytext_ptr
  1943. #ifdef YY_USE_PROTOS
  1944. static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
  1945. #else
  1946. static void yy_flex_strncpy( s1, s2, n )
  1947. char *s1;
  1948. yyconst char *s2;
  1949. int n;
  1950. #endif
  1951.     {
  1952.     register int i;
  1953.     for ( i = 0; i < n; ++i )
  1954.         s1[i] = s2[i];
  1955.     }
  1956. #endif
  1957.  
  1958. #ifdef YY_NEED_STRLEN
  1959. #ifdef YY_USE_PROTOS
  1960. static int yy_flex_strlen( yyconst char *s )
  1961. #else
  1962. static int yy_flex_strlen( s )
  1963. yyconst char *s;
  1964. #endif
  1965.     {
  1966.     register int n;
  1967.     for ( n = 0; s[n]; ++n )
  1968.         ;
  1969.  
  1970.     return n;
  1971.     }
  1972. #endif
  1973.  
  1974.  
  1975. #ifdef YY_USE_PROTOS
  1976. static void *yy_flex_alloc( yy_size_t size )
  1977. #else
  1978. static void *yy_flex_alloc( size )
  1979. yy_size_t size;
  1980. #endif
  1981.     {
  1982.     return (void *) malloc( size );
  1983.     }
  1984.  
  1985. #ifdef YY_USE_PROTOS
  1986. static void *yy_flex_realloc( void *ptr, yy_size_t size )
  1987. #else
  1988. static void *yy_flex_realloc( ptr, size )
  1989. void *ptr;
  1990. yy_size_t size;
  1991. #endif
  1992.     {
  1993.     /* The cast to (char *) in the following accommodates both
  1994.      * implementations that use char* generic pointers, and those
  1995.      * that use void* generic pointers.  It works with the latter
  1996.      * because both ANSI C and C++ allow castless assignment from
  1997.      * any pointer type to void*, and deal with argument conversions
  1998.      * as though doing an assignment.
  1999.      */
  2000.     return (void *) realloc( (char *) ptr, size );
  2001.     }
  2002.  
  2003. #ifdef YY_USE_PROTOS
  2004. static void yy_flex_free( void *ptr )
  2005. #else
  2006. static void yy_flex_free( ptr )
  2007. void *ptr;
  2008. #endif
  2009.     {
  2010.     free( ptr );
  2011.     }
  2012.  
  2013. #if YY_MAIN
  2014. int main()
  2015.     {
  2016.     yylex();
  2017.     return 0;
  2018.     }
  2019. #endif
  2020. #line 183 "tg.l"
  2021.  
  2022.  
  2023.  
  2024.